#include <REGX52.H>
#include "Timer2.h"


void Timer2_Init(void)		//1毫秒@12.000MHz
{
	T2MOD = 0;		//初始化模式寄存器
	T2CON = 0;		//初始化控制寄存器
	TL2 = 0x18;		//设置定时初始值
	TH2 = 0xFC;		//设置定时初始值
	RCAP2L = 0x18;		//设置定时重载值
	RCAP2H = 0xFC;		//设置定时重载值
	TR2 = 1;		//定时器2开始计时
	ET2=1;
	EA=1;
	PT2=0;
}

